package com.ch.engine.daily.valid;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 账户
 *
 * @author wangchunhui
 * @date 2025/3/25 10:58
 */
@Data
public class Account {

    @Min(value = 10, message = "ID不能小于 10", groups = V1.class)
    @Min(value = 20, message = "ID不能小于 20", groups = V2.class)
    private Long id;

    @NotBlank(message = "姓名必需填写v1", groups = V1.class)
    @NotNull(message = "姓名必需填写v2", groups = V2.class)
    private String name;

    @NotBlank(message = "电话必需填写")
    private String phone;

    private List<Account> children;

    /**
     * 分组校验使用
     *
     * @author wangchunhui
     * @date 2025/3/25 10:57
     */
    public static interface V1 {
    }

    public static interface V2 {
    }
}

